﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true"
    CodeFile="RouteList.aspx.cs" Inherits="Admin_RouteList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div>
        <h2 align="center">
            Route List</h2>
        <asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1" AllowPaging="True"
            AllowSorting="True" AutoGenerateColumns="False" CellPadding="3" CellSpacing="1"
            DataKeyNames="RouteID" Width="100%" BackColor="White" BorderColor="White" BorderStyle="Ridge" BorderWidth="2px" GridLines="None">
            <Columns>
                <asp:BoundField DataField="RouteID" HeaderText="Route ID" InsertVisible="False" ReadOnly="True"
                    SortExpression="RouteID">
                    <ItemStyle Width="50px" />
                </asp:BoundField>
                <asp:BoundField DataField="FROM" HeaderText="FROM" ReadOnly="True" SortExpression="FROM" />
                <asp:BoundField DataField="TO" HeaderText="TO" ReadOnly="True" SortExpression="TO" />
                <asp:BoundField DataField="FlyHour" DataFormatString="{0} hours" HeaderText="Fly Hour"
                    SortExpression="FlyHour">
                    <ItemStyle Width="80px" />
                </asp:BoundField>
            </Columns>
            <RowStyle BackColor="#DEDFDE" ForeColor="Black" />
            <FooterStyle BackColor="#C6C3C6" ForeColor="Black" />
            <PagerStyle BackColor="#C6C3C6" ForeColor="Black" HorizontalAlign="Right" />
            <SelectedRowStyle BackColor="#9471DE" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#E7E7FF" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:sqlString %>"
            SelectCommand="SELECT Airline_Route.RouteID, CAST(Airline_Cities.[City Name] AS VARCHAR(50)) + ', ' + CAST(Airline_Cities.State AS VARCHAR(50)) + ', ' + CAST(Airline_Cities.Country AS VARCHAR(50)) AS [FROM], CAST(Airline_Cities_1.[City Name] AS VARCHAR(50)) + ', ' + CAST(Airline_Cities_1.State AS VARCHAR(50)) + ', ' + CAST(Airline_Cities_1.Country AS VARCHAR(50)) AS [TO], Airline_Route.FlyHour FROM Airline_Cities INNER JOIN Airline_Route ON Airline_Cities.CityID = Airline_Route.OriginalCityID INNER JOIN Airline_Cities AS Airline_Cities_1 ON Airline_Route.DestinationCityID = Airline_Cities_1.CityID">
        </asp:SqlDataSource>
        <asp:Button ID="Button1" runat="server" Text="Add New Route" 
            onclick="Button1_Click" />
    </div>
</asp:Content>
